package net.bolue.console.data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.bolue.sysmng.tblbean.ColInfo;
import net.bolue.sysmng.tblbean.UpdRes;
import net.bolue.sysmng.tblbean.UpdTabPage;
import net.bolue.web.entry.FormDataOption;
import net.bolue.web.entry.FormElemTag;

/**
 * 更新信息
 * @author Administrator
 *
 */
public class UpdateInfo extends DataBean{

	/**
	 * 子系统
	 */
	private String subSys;
	
	/**
	 * 更新标识
	 */
	private String updateId;
	
	/**
	 * 更新资源
	 */
	private UpdRes updRes;
	
	/**
	 * 更新数据表列
	 */
	private List<ColInfo> colInfoList;
	
	private List<ColInfo> keyColInfoList;
	
	/**
	 * 更新form标签
	 */
	private List<FormElemTag> elemTagList;
	
	/**
	 * 更新tab页
	 */
	private List<UpdTabPage> tabPage;
	
	/**
	 * 数据
	 */
	private Map<String,Object> dataMap;
	
	/**
	 * 字典
	 */
	private Map<String,List<FormDataOption>> dicsMap;
	
	private Map<String,ColInfo> colInfoMap;
	
	/**
	 * 更新列
	 */
	private String[] updColArray;
	
	/**
	 * 条件列
	 */
	private String[] whereColArray;
	
	/**
	 * 更新数据
	 */
	private Map<String,Object> updateDataMap;
	
	/**
	 * 条件数据
	 */
	private Map<String,Object> whereDataMap;
	
	public UpdateInfo(){
		
	}
	
	public UpdateInfo(String subSys,String updateId){
		this.subSys = subSys;
		this.updateId = updateId;
	}
	
	public String getSubSys() {
		return subSys;
	}

	public void setSubSys(String subSys) {
		this.subSys = subSys;
	}

	public String getUpdateId() {
		return updateId;
	}

	public void setUpdateId(String updateId) {
		this.updateId = updateId;
	}

	public UpdRes getUpdRes() {
		return updRes;
	}

	public void setUpdRes(UpdRes updRes) {
		this.updRes = updRes;
	}

	public List<ColInfo> getColInfoList() {
		return colInfoList;
	}

	public void setColInfoList(List<ColInfo> colInfoList) {
		this.colInfoList = colInfoList;
	}

	public List<FormElemTag> getElemTagList() {
		return elemTagList;
	}

	public void setElemTagList(List<FormElemTag> elemTagList) {
		this.elemTagList = elemTagList;
	}

	public List<UpdTabPage> getTabPage() {
		return tabPage;
	}

	public void setTabPage(List<UpdTabPage> tabPage) {
		this.tabPage = tabPage;
	}

	public Map<String, Object> getDataMap() {
		return dataMap;
	}

	public void setDataMap(Map<String, Object> dataMap) {
		this.dataMap = dataMap;
	}

	public Map<String, List<FormDataOption>> getDicsMap() {
		return dicsMap;
	}

	public void setDicsMap(Map<String, List<FormDataOption>> dicsMap) {
		this.dicsMap = dicsMap;
	}

	public List<ColInfo> getKeyColInfoList() {
		if(keyColInfoList==null&&this.colInfoList!=null){
			keyColInfoList = new ArrayList<ColInfo>();
			for(ColInfo colInfo : colInfoList){
				if(colInfo.getIsPkey()==1){
					keyColInfoList.add(colInfo);
				}
			}
		}
		return keyColInfoList;
	}

	public void setKeyColInfoList(List<ColInfo> keyColInfoList) {
		this.keyColInfoList = keyColInfoList;
	}

	public Map<String, ColInfo> getColInfoMap() {
		if(colInfoMap==null&&this.colInfoList!=null){
			colInfoMap = new HashMap<String,ColInfo>();
			for(ColInfo colInfo : colInfoList){
				colInfoMap.put(colInfo.getColName(), colInfo);
			}
		}
		return colInfoMap;
	}

	public void setColInfoMap(Map<String, ColInfo> colInfoMap) {
		this.colInfoMap = colInfoMap;
	}

	public Map<String, Object> getUpdateDataMap() {
		return updateDataMap;
	}

	public void setUpdateDataMap(Map<String, Object> updateDataMap) {
		this.updateDataMap = updateDataMap;
	}

	public Map<String, Object> getWhereDataMap() {
		return whereDataMap;
	}

	public void setWhereDataMap(Map<String, Object> whereDataMap) {
		this.whereDataMap = whereDataMap;
	}

	public String[] getUpdColArray() {
		return updColArray;
	}

	public void setUpdColArray(String[] updColArray) {
		this.updColArray = updColArray;
	}

	public String[] getWhereColArray() {
		return whereColArray;
	}

	public void setWhereColArray(String[] whereColArray) {
		this.whereColArray = whereColArray;
	}
	
}
